<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function createHero(name, age, sex, mp, hp) {
            var obj = new Object();
            obj.name = name;
            obj.age = age;
            obj.sex = sex;
            obj.mp = mp;
            obj.hp = hp;
            return obj;
        }
        var hero01 = createHero('剑仙李白', '男', '1000岁', 2000, 4);
        console.log(hero01);
    </script>
</body>

</html>